home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1999 #2
/
Amiga Plus CD - 1999 - No. 2.iso
/
Anwender
/
Grafik
/
PPT
/
rexx
/
pixelize.prx
< prev
next >
Wrap
Text File
|
1998-06-29
|
1KB
|
67 lines
/*
This pixelifies the image.
$Id: Pixelize.prx 1.2 1998/06/29 20:52:22 jj Exp jj $
*/
/*-------------------------------------------------------------------*/
/* I suggest you use this header as-is and add your own code below */
OPTIONS RESULTS
SIGNAL ON ERROR
IF ADDRESS() = REXX THEN DO
startedfromcli = 1
ADDRESS PPT
END
ELSE DO
startedfromcli = 0
ADDRESS PPT
END
RESULT = 'no result'
/*-------------------------------------------------------------------*/
/* Add your code here */
PARSE ARG frame
IF DATATYPE(frame) ~= NUM THEN DO
RC = 10
RC2 = "No frame selected"
SIGNAL ERROR
END
MYREQ.TYPE=SLIDER
MYREQ.MIN=1
MYREQ.MAX=20
MYREQ.DEFAULT=2
MYREQ.LABEL='"Pixel size?"'
ASKREQ '"Pixelising image..."' MYREQ
IF result = 0 THEN DO
FRAMEINFO frame STEM inf
neww = inf.width % MYREQ.VALUE
newh = inf.height % MYREQ.VALUE
PROCESS FRAME 'SCALE NEWHEIGHT='newh' NEWWIDTH='neww' MODE=QUICK'
PROCESS FRAME 'SCALE NEWHEIGHT='inf.height' NEWWIDTH='inf.width' MODE=QUICK'
END
EXIT
/*-------------------------------------------------------------------*/
/* Again, keep this part intact. This is the error handler. */
ERROR :
returncode = RC
IF startedfromcli = 1 THEN DO
SAY 'ERROR ' returncode ' on line ' SIGL ': ' RC2
PPT_TO_BACK
END
ELSE
SHOWERROR '"'RC2'"' SIGL
EXIT returncode